load("@rules_cc//cc:defs.bzl", "cc_test")

_TESTS = [
    ("action", "cont_concepts"),
    ("action", "adjacent_remove_if"),
    ("action", "drop"),
    ("action", "drop_while"),
    ("action", "insert"),
    ("action", "join"),
    ("action", "push_front"),
    ("action", "push_back"),
    ("action", "remove_if"),
    ("action", "remove"),
    ("action", "unstable_remove_if"),
    ("action", "reverse"),
    ("action", "shuffle"),
    ("action", "slice"),
    ("action", "sort"),
    ("action", "split"),
    ("action", "stable_sort"),
    ("action", "stride"),
    ("action", "take"),
    ("action", "take_while"),
    ("action", "transform"),
    ("action", "unique"),
    ("algorithm", "adjacent_find"),
    ("algorithm", "adjacent_remove_if"),
    ("algorithm", "all_of"),
    ("algorithm", "any_of"),
    ("algorithm", "none_of"),
    ("algorithm", "binary_search"),
    ("algorithm", "contains"),
    ("algorithm", "copy"),
    ("algorithm", "copy_backward"),
    ("algorithm", "copy_if"),
    ("algorithm", "count"),
    ("algorithm", "count_if"),
    ("algorithm", "ends_with"),
    ("algorithm", "equal"),
    ("algorithm", "equal_range"),
    ("algorithm", "fill"),
    ("algorithm", "find"),
    ("algorithm", "find_end"),
    ("algorithm", "find_if"),
    ("algorithm", "find_if_not"),
    ("algorithm", "find_first_of"),
    ("algorithm", "fold"),
    ("algorithm", "for_each"),
    ("algorithm", "for_each_n"),
    ("algorithm", "generate"),
    ("algorithm", "generate_n"),
    ("algorithm", "includes"),
    ("algorithm", "inplace_merge"),
    ("algorithm", "is_heap1"),
    ("algorithm", "is_heap2"),
    ("algorithm", "is_heap3"),
    ("algorithm", "is_heap4"),
    ("algorithm", "is_heap_until1"),
    ("algorithm", "is_heap_until2"),
    ("algorithm", "is_heap_until3"),
    ("algorithm", "is_heap_until4"),
    ("algorithm", "is_partitioned"),
    ("algorithm", "is_permutation"),
    ("algorithm", "is_sorted_until"),
    ("algorithm", "is_sorted"),
    ("algorithm", "lexicographical_compare"),
    ("algorithm", "lower_bound"),
    ("algorithm", "make_heap"),
    ("algorithm", "max"),
    ("algorithm", "max_element"),
    ("algorithm", "merge"),
    ("algorithm", "min"),
    ("algorithm", "min_element"),
    ("algorithm", "minmax"),
    ("algorithm", "minmax_element"),
    ("algorithm", "mismatch"),
    ("algorithm", "move"),
    ("algorithm", "move_backward"),
    ("algorithm", "next_permutation"),
    ("algorithm", "nth_element"),
    ("algorithm", "partial_sort"),
    ("algorithm", "partial_sort_copy"),
    ("algorithm", "partition"),
    ("algorithm", "partition_copy"),
    ("algorithm", "partition_point"),
    ("algorithm", "pop_heap"),
    ("algorithm", "prev_permutation"),
    ("algorithm", "push_heap"),
    ("algorithm", "remove"),
    ("algorithm", "remove_copy"),
    ("algorithm", "remove_copy_if"),
    ("algorithm", "remove_if"),
    ("algorithm", "replace"),
    ("algorithm", "replace_copy"),
    ("algorithm", "replace_copy_if"),
    ("algorithm", "replace_if"),
    ("algorithm", "reverse"),
    ("algorithm", "reverse_copy"),
    ("algorithm", "rotate"),
    ("algorithm", "rotate_copy"),
    ("algorithm", "sample"),
    ("algorithm", "search"),
    ("algorithm", "search_n"),
    ("algorithm", "set_difference1"),
    ("algorithm", "set_difference2"),
    ("algorithm", "set_difference3"),
    ("algorithm", "set_difference4"),
    ("algorithm", "set_difference5"),
    ("algorithm", "set_difference6"),
    ("algorithm", "set_intersection1"),
    ("algorithm", "set_intersection2"),
    ("algorithm", "set_intersection3"),
    ("algorithm", "set_intersection4"),
    ("algorithm", "set_intersection5"),
    ("algorithm", "set_intersection6"),
    ("algorithm", "set_symmetric_difference1"),
    ("algorithm", "set_symmetric_difference2"),
    ("algorithm", "set_symmetric_difference3"),
    ("algorithm", "set_symmetric_difference4"),
    ("algorithm", "set_symmetric_difference5"),
    ("algorithm", "set_symmetric_difference6"),
    ("algorithm", "set_union1"),
    ("algorithm", "set_union2"),
    ("algorithm", "set_union3"),
    ("algorithm", "set_union4"),
    ("algorithm", "set_union5"),
    ("algorithm", "set_union6"),
    ("algorithm", "shuffle"),
    ("algorithm", "sort"),
    ("algorithm", "sort_heap"),
    ("algorithm", "stable_partition"),
    ("algorithm", "stable_sort"),
    ("algorithm", "starts_with"),
    ("algorithm", "swap_ranges"),
    ("algorithm", "transform"),
    ("algorithm", "unique"),
    ("algorithm", "unique_copy"),
    ("algorithm", "unstable_remove_if"),
    ("algorithm", "upper_bound"),
    ("algorithm", "sort_n_with_buffer"),
    ("functional", "bind_back"),
    ("functional", "on"),
    ("iterator", "basic_iterator"),
    ("iterator", "diffmax_t"),
    ("iterator", "iterator"),
    ("iterator", "common_iterator"),
    ("iterator", "reverse_iterator"),
    ("iterator", "unformatted_ostream_iterator"),
    ("iterator", "counted_iterator"),
    ("numeric", "accumulate"),
    ("numeric", "adjacent_difference"),
    ("numeric", "inner_product"),
    ("numeric", "iota"),
    ("numeric", "partial_sum"),
    ("range", "access"),
    ("range", "conversion"),
    ("range", "index"),
    ("range", "operations"),
    ("utility", "box"),
    ("utility", "concepts"),
    ("utility", "common_type"),
    ("utility", "compare"),
    ("utility", "functional"),
    ("utility", "swap"),
    ("utility", "variant"),
    ("utility", "meta"),
    ("utility", "scope_exit"),
    ("utility", "semiregular_box"),
    ("view", "adaptor"),
    ("view", "addressof"),
    ("view", "adjacent_remove_if"),
    ("view", "all"),
    ("view", "any_view"),
    ("view", "common"),
    ("view", "cache1"),
    ("view", "cartesian_product"),
    ("view", "chunk"),
    ("view", "chunk_by"),
    ("view", "concat"),
    ("view", "const"),
    ("view", "conversion"),
    ("view", "counted"),
    ("view", "cycle"),
    ("view", "delimit"),
    ("view", "drop"),
    ("view", "drop_exactly"),
    ("view", "drop_while"),
    ("view", "drop_last"),
    ("view", "enumerate"),
    ("view", "exclusive_scan"),
    ("view", "facade"),
    ("view", "generate"),
    ("view", "generate_n"),
    ("view", "getlines"),
    ("view", "group_by"),
    ("view", "indirect"),
    ("view", "intersperse"),
    ("view", "iota"),
    ("view", "istream"),
    ("view", "iterator_range"),
    ("view", "join"),
    ("view", "keys_value"),
    ("view", "linear_distribute"),
    ("view", "move"),
    ("view", "partial_sum"),
    ("view", "repeat"),
    ("view", "remove"),
    ("view", "remove_if"),
    ("view", "replace"),
    ("view", "replace_if"),
    ("view", "reverse"),
    ("view", "sample"),
    ("view", "set_difference"),
    ("view", "set_intersection"),
    ("view", "set_symmetric_difference"),
    ("view", "set_union"),
    ("view", "slice"),
    ("view", "sliding"),
    ("view", "span"),
    ("view", "split"),
    ("view", "stride"),
    ("view", "subrange"),
    ("view", "tail"),
    ("view", "take"),
    ("view", "take_exactly"),
    ("view", "take_last"),
    ("view", "take_while"),
    ("view", "tokenize"),
    ("view", "transform"),
    ("view", "trim"),
    ("view", "unique"),
    ("view", "view"),
    ("view", "zip"),
]

[cc_test(
    name = ".".join(test),
    size = "small",
    srcs = glob(["**/*.hpp"] + [
        "{}/{}.cpp".format(
            test[0],
            test[1],
        ),
    ]),
    deps = [
        "@range-v3",
    ],
) for test in _TESTS]

[cc_test(
    name = test,
    size = "small",
    srcs = glob(["**/*.hpp"] + [
        "{}.cpp".format(test),
    ]),
    deps = [
        "@range-v3",
    ],
) for test in [
    "config",
    "constexpr_core",
    "bug474",
    "bug566",
    "bug1322",
    "bug1335",
    "bug1633",
]]

cc_test(
    name = "multiple",
    size = "small",
    srcs = glob(["**/*.hpp"] + [
        "multiple1.cpp",
        "multiple2.cpp",
    ]),
    deps = [
        "@range-v3",
    ],
)
